<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="Totomo">
  <meta name="Keywords" content="lottery">
  <meta name="Description" content="双色球模拟器">
  <title>双色球模拟器</title>
  <style type="text/css">
	input{
		width:200px;
	}
  </style>
  <script type="text/javascript">
	function refresh(){
		// 1-33,1-16
		// 不能重复
		var num;
		var str= "";
		var arr= new Array(6);
		for (var i=0; i<6; i++)
		{
			num = Math.floor(Math.random()*32+1);
			if(i>0){
				for (var ii=0; ii<i; ii++)
				{
					if (arr[ii]==num)
					{
						num = Math.floor(Math.random()*32+1);
					}
				}
			}
			arr[i] = num;
		}
		// 冒泡排序
		for (var i=0; i<arr.length; i++)
		{
			for (var ii=i+1; ii<arr.length; ii++)
			{
				if(arr[ii]<arr[i]){
					var n = arr[i];
					arr[i] = arr[ii];
					arr[ii] = n;
				}
			}
		}
		// 输出
		for (var i=0;i<arr.length;i++)
		{
			if(arr[i]<10){
				str = str + "0"+ arr[i] + " ";
			}else{
				str = str + arr[i] + " ";
			}
			if(i==5){
				num = Math.floor(Math.random()*15+1);
				if (num<10)
				{
					str = str + "- 0" + num;
				}else{
					str = str + "- " + num;
				}
			}
		}
		return str;
	}

	function mutilottery(muti1){
		var str='';
		muti1 = Number(muti1);
		for (var i=0;i<muti1;i++){
			str = str + "<br/>" + refresh();
		}
		document.getElementById('muti').innerHTML=str;
	}
	
  </script>
 </head>
 <body>
  <h4>双色球功能:</h4>
	<p>1.随机产生一注彩票(六个红球 + 一个篮球); 注意红球不能重复√<br/>
	2.对随机产生的彩票进行排序, 输出打印√<br/>
	3.随机产生N注彩票√<br/>
	4.对产生的每注彩票进行分析; 奇偶比, 小中大区间比, 和值等<br/>
	5.对产生的N注彩票总体进行分析, 每个球出现的概率<br/>
	6.对概率进行排序,从大往小排序<br/>
	7.根据概率机会, 抓取中奖比较高的彩票; 比如3个高概率区间(前6个随机)+2个中8.概率区间+1个低概率区间<br/></p>
	<br/>
	产生一注：<input type="text" id="re"/>
	<button onclick="document.getElementById('re').value=(refresh());">产生</button><br/>
	产生多注：<input type="number" id="mutiple" style="width:50px" maxlength="4">
	<button onclick="mutilottery(document.getElementById('mutiple').value);">产生</button><br/>
	<span id="percentage"></span><br/>
	<span id="muti"></span><br/>
 </body>
</html>
